package com.rentong.wx.cust.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
public class SaveCanyinquanDto {


    /**
     * 发布的内容
     */
    private String canyinquanContent;

    /**
     * 经度
     */
    private BigDecimal longitude;

    /**
     * 纬度
     */
    private BigDecimal latitude;

    /**
     * 详细地址
     */
    private String address;

//    //图片
//    private List<String> canyinquanPics;

    /**
     * 餐饮圈标签的id
     */
    private Long canyinquanLabelIdOne;

    /**
     * 餐饮圈标签的id
     */
    private Long canyinquanLabelIdTwo;

    //购买帮上推的id
    private Long bstId;

    //图片
    private String canyinquanPic1;
    private String canyinquanPic2;
    private String canyinquanPic3;
    private String canyinquanPic4;
    private String canyinquanPic5;
    private String canyinquanPic6;
    private String canyinquanPic7;
    private String canyinquanPic8;
    private String canyinquanPic9;
    private String canyinquanPic10;

    public List<String> getNonEmptyPictures() {
        List<String> nonEmptyPics = new ArrayList<>();
        addPicIfNotNull(nonEmptyPics, canyinquanPic1);
        addPicIfNotNull(nonEmptyPics, canyinquanPic2);
        addPicIfNotNull(nonEmptyPics, canyinquanPic3);
        addPicIfNotNull(nonEmptyPics, canyinquanPic4);
        addPicIfNotNull(nonEmptyPics, canyinquanPic5);
        addPicIfNotNull(nonEmptyPics, canyinquanPic6);
        addPicIfNotNull(nonEmptyPics, canyinquanPic7);
        addPicIfNotNull(nonEmptyPics, canyinquanPic8);
        addPicIfNotNull(nonEmptyPics, canyinquanPic9);
        addPicIfNotNull(nonEmptyPics, canyinquanPic10);

        return nonEmptyPics;
    }

    private void addPicIfNotNull(List<String> picList, String pic) {
        if (pic != null && !pic.trim().isEmpty()) {
            picList.add(pic);
        }
    }

}
